<template>
  <div>
    <He />
    <SS />
    <TS />
    <CT :zitext="futext1" />
  </div>
</template>

<script>
import He from "../components/guanzhu/header.vue";
import SS from "../components/guanzhu/search.vue";
import TS from "../components/guanzhu/tishi.vue";
import CT from "../components/guanzhu/content.vue";
export default {
  components: {
    He,
    SS,
    TS,
    CT,
  },
  data() {
    return {
      futext1: [],
    };
  },
  created() {
    if (sessionStorage.getItem("store")) {
      this.$store.replaceState(
        Object.assign(
          {},
          this.$store.state,
          JSON.parse(sessionStorage.getItem("store"))
        )
      );
    }

    //在页面刷新时将vuex里的信息保存到sessionStorage里
    window.addEventListener("beforeunload", () => {
      sessionStorage.setItem("store", JSON.stringify(this.$store.state));
    });
    this.$store.dispatch("aa", { url: "/data/one" });
  },
  // computed: {
  //   huoqu() {
  //     return this.$store.state.guanzhu.getb[0];
  //   },
  // }
  mounted() {
    // console.log("1", this.$store.state.guanzhu.getb);
    this.futext1 = this.$store.state.guanzhu1.getb;
    console.log(this.futext1);
  },
};
</script>

<style>
</style>